<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
</head>
<body>
<a href="addTable.jsp">添加表</a>
<form action="/web/GetAllTableServlet" method="get">
    <select name="tableName">
        <c:forEach items="${tableNames}" var="item">
            <option value="${item}">${item}</option>
        </c:forEach>
    </select>
    <input type="submit" value="提交">
</form>
<table>
    <caption>${table.tabbleName}表
    </caption>
    <thead>
    <tr>
        <c:forEach items="${table.columnName}" var="columnName">
            <th>${columnName}</th>
            <input type="hidden" name="columnName" value="${column}"/>
        </c:forEach>
        <th>
            操作
        </th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${table.data}" var="row">
        <tr>
            <form action="ToUpdateServlet" method="post">
                <c:forEach items="${row}" var="column" varStatus="status">
                    <td>${column}</td>
                    <input type="hidden" name="row" value="${column}"/>
                </c:forEach>
                <td>
                    <div>
                        <input type="hidden" name="tablename" value="${table.tabbleName}">
                        <button type="submit">编辑</button>
                        <button type="button">删除</button>
                    </div>
                </td>
            </form>
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>
